﻿@using MvcTemplates

@{
    object modelValue;
    if ( ViewData.TemplateInfo.FormattedModelValue == ViewData.ModelMetadata.Model ) 
    {
        modelValue = string.Format( System.Globalization.CultureInfo.CurrentCulture, "{0:0.00}", ViewData.ModelMetadata.Model );
    }
    else
    {
        modelValue = ViewData.TemplateInfo.FormattedModelValue;
    }
}

@Html.TextBox( "", modelValue, ViewData.ModelMetadata.MergeAttributes<HtmlAttributesAttribute>( new { @class = Html.GetProfile().DecimalClasses } ) )